/*
   Copyright (C) 2007 Yen-Ju Chen <yjchenx gmail>

   This application is free software; you can redistribute it and/or 
   modify it under the terms of the MIT license. See COPYING.

*/

#import <OrganizeKit/OrganizeKit.h>

/* Post this when a factory is updated. Oobject is that factory */
#define KRFactoryDidUpdateNotification (@"KRFactoryDidUpdateNotification")

typedef enum _KRFactoryViewableMask
{
	KRFactoryBrowserViewableMask = 1 << 0,
	KRFactoryItemViewableMask = 1 << 1,
	KRFactoryContentViewableMask = 1 << 2
} KRFactoryViewableMask;

@protocol KRFactoryProtocol
- (OKGroup *) rootGroup;
/* Decide which kind of view to display on the right side of window */
- (unsigned int) viewableMask;

/* KRFactoryItemViewableMask */
- (NSArray *) propertiesToDisplay; /* Item properties to display */
@end

/* Optional */
@interface NSObject (KRFactoryProtocol)

/* Implement it if it is ContentViewable */
- (NSView *) contentView;

/* Give data source a change to update group on demand */
- (void) willDisplayGroup: (OKGroup *) group;
- (void) didSelectObject: (OKObject *) object;

/* This menu is on main menu */
- (NSArray *) collectionMenuItems;
/* This menu is mostly used on items */
- (NSMenu *) actionMenu; 
@end
